package com.sxdz.constant


/**
 *
 */
public enum MessageConstant   {
    SUCCESS("0000", "操作成功"),
    FAILURE("1111","操作失败"),
    ERR_PARAMETER("2222","参数错误"),
    FAIL_QUERY("3333", "没有数据"),
    FAILURE_JUDGE("1112","订购产品校验失败"),
    ERR_PASSWORD_DIFFER("1020","当前密码错误"),
    USERNAME_ALREADY_EXISTS("1050","登录名已存在"),
    SYS_ERROR("9999","系统异常"),

    private String code;
    private String desc;
    MessageConstant(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return this.code;
    }

    public String getDesc() {
        return this.desc;
    }

    public String getMsg(Object ... args) {

        String msgT = ""//ResCodeMessageCache.getMessageDesc(this.code);
        try {
            return String.format(msgT, args);
        } catch (Exception e) {
            return "<"+this.code+">消息解析失败：" + msgT +" >> "+e.getMessage();
        }
    }

}
